import axios from "@/utils/request";

//获取活动列表
export function getList() {
    return axios({
        url: "/activity/activity/web/list",
        method: "get"
    })
}

//根据活动id查询活动和优惠券
export function getActivityAndVoucher(id: number) {
    return axios({
        url: "/activity/activity/web/getActivityAndVoucher/" + id,
        method: "get"
    })
}

//优惠券秒杀
export function voucherSecKill(id: number, userId: number) {
    return axios({
        url: `/activity/voucherOrder/web/voucherSecKill/${id}/${userId}`,
        method: "post"
    })
}

//统一收单下单并支付页面接口的调用
export function tradePagePay(activityId: number, userId: number) {
    return axios({
        url: `/payment/aliPay/web/trade/${activityId}/${userId}`,
        method: "post"
    })
}